package com.cmfi.controller.userRoleAuthController;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.cmfi.domain.userRoleAuthEntity.AjaxResult;
import com.cmfi.domain.userRoleAuthEntity.User;
import com.cmfi.service.inter.userRoleAuthInter.LoginService;


@RestController
@RequestMapping("/api")
public class LoginController {

    @Autowired
    private LoginService loginService;
    @PostMapping("/authenticate")//2、登录
    public AjaxResult login(@RequestBody User user){
        //登录
        return loginService.login(user);
    }
    

    @RequestMapping("/user/logout")
    public AjaxResult logout(){
        return loginService.logout();
    }

}
